<template lang="">
<van-swipe class="my-swipe" :autoplay="4000" indicator-color="white">
  <van-swipe-item v-for="(item,index) in list" :key="index">
  <img :src="item.imgSrc"/>
  </van-swipe-item>
</van-swipe>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import axios from 'axios'

interface ISwipe {
  link: string
  imgSrc: string
}

const list = ref<ISwipe[]>([])

axios({
  url: '/swiperList',
  method: 'get',
}).then(res => {
  console.log(res.data.result)
  list.value = res.data.result
})
</script>

<style lang="less" scoped>
.my-swipe{
  img{
    width: 100%;
  }
}
</style>
